function Observe(obj, name, value) {
  Object.defineProperty(obj, name, {
    get() {
      console.log('获取数据')
      return value
    },
    set(newValue) {
      console.log('设置数据')
      value = newValue
    },
  })
}

let obj = { name: '李四', age: 23 }

Observe(obj, 'name', obj.name)
obj.name = 'Lee'
console.log(obj.name)

Observe(obj, 'age', obj.age)
obj.age = 88
console.log(obj.age)

// obj.name = 'Lee'
// console.log(obj.name)
